package org.dtrd.modules.evaluation.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.evaluation.entity.bean.MmpiDetail;

import java.util.Date;
import java.util.List;
import java.util.StringJoiner;


/**
 * <p>
 * 明苏尼达多相个性评估
 * </p>
 *
 * @author QR
 * @since 2021-12-15
 */
@Getter
@Setter
@TableName("dtrd_ent_evaluation_rd_mmpi")
public class DtrdEntEvaluationRdMmpi {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("patient_id")
    private Integer patientId;

    @TableField("create_time")
    private Date createTime;

    @TableField("input")
    private String input;

    @TableField("gender")
    private Integer gender;

    @TableField("fq_score")
    private Float fqScore;

    @TableField("fq_level")
    private String fqLevel;

    @TableField("fl_score")
    private Float flScore;

    @TableField("fl_level")
    private String flLevel;

    @TableField("ff_score")
    private Float ffScore;

    @TableField("ff_level")
    private String ffLevel;

    @TableField("fk_score")
    private Float fkScore;

    @TableField("fk_level")
    private String fkLevel;

    @TableField("fhs_score")
    private Float fhsScore;

    @TableField("fhs_level")
    private String fhsLevel;

    @TableField("fd_score")
    private Float fdScore;

    @TableField("fd_level")
    private String fdLevel;

    @TableField("fhy_score")
    private Float fhyScore;

    @TableField("fhy_level")
    private String fhyLevel;

    @TableField("fpd_score")
    private Float fpdScore;

    @TableField("fpd_level")
    private String fpdLevel;

    @TableField("fmfm_score")
    private Float fmfmScore;

    @TableField("fmfm_level")
    private String fmfmLevel;

    @TableField("fmff_score")
    private Float fmffScore;

    @TableField("fmff_level")
    private String fmffLevel;

    @TableField("fpa_score")
    private Float fpaScore;

    @TableField("fpa_level")
    private String fpaLevel;

    @TableField("fpt_score")
    private Float fptScore;

    @TableField("fpt_level")
    private String fptLevel;

    @TableField("fsc_score")
    private Float fscScore;

    @TableField("fsc_level")
    private String fscLevel;

    @TableField("fma_score")
    private Float fmaScore;

    @TableField("fma_level")
    private String fmaLevel;

    @TableField("fsi_score")
    private Float fsiScore;

    @TableField("fsi_level")
    private String fsiLevel;

    @TableField("fmas_score")
    private Float fmasScore;

    @TableField("fmas_level")
    private String fmasLevel;

    @TableField("fdy_score")
    private Float fdyScore;

    @TableField("fdy_level")
    private String fdyLevel;

    @TableField("fdo_score")
    private Float fdoScore;

    @TableField("fdo_level")
    private String fdoLevel;

    @TableField("fre_score")
    private Float freScore;

    @TableField("fre_level")
    private String freLevel;

    @TableField("fcn_score")
    private Float fcnScore;

    @TableField("fcn_level")
    private String fcnLevel;

    /**
     * 输出内容
     */
    @TableField("output")
    private String output;

    public DtrdEntEvaluationRdMmpi init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdEntEvaluationRdMmpi parseFromDto(MmpiDetail dto) {
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        List<Integer> inputList = dto.getInput();
        StringJoiner joiner = new StringJoiner(",");
        inputList.forEach(answer -> joiner.add(answer+""));
        this.input = joiner.toString();
        gender = dto.getGender();
        fqScore = dto.getFqScore();
        fqLevel = dto.getFqLevel();
        flScore = dto.getFlScore();
        flLevel = dto.getFlLevel();
        ffScore = dto.getFfScore();
        ffLevel = dto.getFfLevel();
        fkScore = dto.getFkScore();
        fkLevel = dto.getFkLevel();
        fhsScore = dto.getFhsScore();
        fhsLevel = dto.getFhsLevel();
        fdScore = dto.getFdScore();
        fdLevel = dto.getFdLevel();
        fhyScore = dto.getFhyScore();
        fhyLevel = dto.getFhyLevel();
        fpdScore = dto.getFpdScore();
        fpdLevel = dto.getFpdLevel();
        fmfmScore = dto.getFmfmScore();
        fmfmLevel = dto.getFmfmLevel();
        fmffScore = dto.getFmffScore();
        fmffLevel = dto.getFmffLevel();
        fpaScore = dto.getFpaScore();
        fpaLevel = dto.getFpaLevel();
        fptScore = dto.getFptScore();
        fptLevel = dto.getFptLevel();
        fscScore = dto.getFscScore();
        fscLevel = dto.getFscLevel();
        fmaScore = dto.getFmaScore();
        fmaLevel = dto.getFmaLevel();
        fsiScore = dto.getFsiScore();
        fsiLevel = dto.getFsiLevel();
        fmasScore = dto.getFmasScore();
        fmasLevel = dto.getFmasLevel();
        fdyScore = dto.getFdyScore();
        fdyLevel = dto.getFdyLevel();
        fdoScore = dto.getFdoScore();
        fdoLevel = dto.getFdoLevel();
        freScore = dto.getFreScore();
        freLevel = dto.getFreLevel();
        fcnScore = dto.getFcnScore();
        fcnLevel = dto.getFcnLevel();
        output = dto.getOutput();
        return this;
    }


}
